import {
  Entity,
  PrimaryGeneratedColumn,
  Column,
  CreateDateColumn,
  OneToMany,
} from "typeorm";
import { Message } from "./message.entity";
@Entity()
export class Conversation {
  @PrimaryGeneratedColumn("uuid") id: string;
  @Column() type: string;
  @Column({ nullable: true }) title: string;
  @CreateDateColumn() createdAt: Date;
  @OneToMany(() => Message, (m) => (m as any).conversation) messages: Message[];
}
